home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-07-31 | 2.2 KB | 97 lines | [TEXT/MPS ] |
- # Script for CIncludes Tool - by John Jeppson
-
- set exit 0
- set param 0
- set toolStatus 0
-
- if {#} == 1
- if ("{1}" == "-m") || ("{1}" == "-M")
- set param 1
- else if ("{1}" == "-f") || ("{1}" == "-F")
- set param 2
- else if ("{1}" == "-i") || ("{1}" == "-I")
- set param 3
- else if ("{1}" == "-d") || ("{1}" == "-D") # Daniel Grassi
- set param 4
- end
- end
-
- if {param} == 0
- beep
- echo
- echo 'CIncludesTool must be called with a single parameter:'
- echo ' -f Locates selection from active window'
- echo ' -m Rebuilds the CIncludes identifier dictionary'
- echo ' -i Reformats "#include" statements in selection'
- echo ' -d Displays the "#include" file declaring the selection' # Daniel Grassi
- echo
-
- else if {param} == 1
- find §:/∞/ "{Active}"; find §Δ "{Active}"; echo
- CIncludesCode -m `files -f {CIncludes}≈.h`
- set toolStatus "{Status}"
- Beep 2C,20,128
-
- else if {param} == 2
- Mark -y § x162534 "{Active}"
-
- set str "`catenate "{Active}".§`"
- CIncludesCode -v "{str}"
- set toolStatus "{Status}"
-
- if {toolStatus} == 0
- find • "{Active}"
- find Δ/#include/ "{Active}" # Daniel Grassi
- CIncludesCode -f "{str}"
- set toolStatus "{Status}"
- end
-
- find x162534 "{Active}"
- UnMark x162534 "{Active}"
-
- else if {param} == 3
- CIncludesCode -i "{Active}.§"
- set toolStatus "{Status}"
-
- else if {param} == 4 # Daniel Grassi
- set str "`catenate "{Active}".§`"
- CIncludesCode -v "{str}"
- set toolStatus "{Status}"
-
- if {toolStatus} == 0
- set counter 1
- for i in `CIncludesCode -d "{str}"`
- if {counter} == 1
- open -r {CIncludes}"{i}"
- set counter 2
- else
- find •!{i} "{Active}"
- find \{str}\ "{Active}"
- end
- end
- set toolStatus "{Status}"
- end
- end
-
-
- if {toolStatus}
- beep
- echo
-
- if {toolStatus} == '1'
- echo 'Bad Parameters to "CIncludesCode"' # won't occur here
- else if {toolStatus} == '2'
- echo 'Invalid Identifier!'
- else if {toolStatus} == '3'
- if ({param} == 2) || (param} == 3)
- echo 'Unable to Load DataBase Resource!'
- else
- echo 'Out of Memory error!'
- end
- else if {toolStatus} == '4'
- echo 'Identifier not found in CIncludes!'
- end
-
- echo
- end
-